package org.asdt.core.internal.antlr;

import antlr.ASTFactory;
import antlr.collections.AST;

public class ASSourceASTFactory extends ASTFactory {

	public ASSourceASTFactory() {
		super();
		setASTNodeClass(ASSourceAST.class);
	}
    
    /* (non-Javadoc)
     * @see antlr.ASTFactory#dupTree(antlr.collections.AST)
     */
    public AST dupTree(AST t){
    	AST dup = super.dupTree(t);
    	if(t instanceof ASSourceAST && dup instanceof ASSourceAST){
    		ASSourceAST as2dup = (ASSourceAST) dup;
    		as2dup.setEndOffset(t);
    	}
    	return dup;
    }
}
